package oralExamSchedulingSystemTest;

import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedList;

import junit.framework.*;
import oralExamSchedulingSystem.IO;
import oralExamSchedulingSystem.Scheduler;
import oralExamSchedulingSystem.Student;
import oralExamSchedulingSystem.Timetable;

import org.junit.Before;
import org.junit.Test;

public class TestScheduler extends TestCase {

	private Scheduler scheduler;
	private Timetable timetable;
	private Student[] student = null;

	
	
	public TestScheduler(String name)
	{
		super(name);
		
	}
	
	@Before
	public void setUp() {
		scheduler = new Scheduler();
		student = new Student[5];
	}

	public void tearDown() {

	}
	
	@Test
	public void testAssignStudentListToTimeSlot() {
		fail("test");
	}
	
	@Test
	public void testSchedule(){
		int _normalGroupSize = 4;
		int _group = 7;
		LinkedList<String> roomNum=new LinkedList<String>();
		
		roomNum.add("501");
		roomNum.add("502");
		roomNum.add("503");
		roomNum.add("504");
		roomNum.add("505");
		roomNum.add("506");
		roomNum.add("507");
		IO io=new IO();
		ArrayList <Student> studentList=null;
		try{
		studentList=io.getCsvStudentList();
		}catch(Exception e){
			System.out.println("Wrong path");
		}
		
		Timetable chineseTimeTable=new Timetable("Chinese","101","1/2",540,15,4,28,7,roomNum);
		new Scheduler().schedule(chineseTimeTable, studentList, _normalGroupSize, _group,roomNum);
	}
	
//	@Test
//	public void testScheduler() {
//		//fail("test");
//		int roomNum = 101;
//		
//		
//		Date date = null;
//		java.text.SimpleDateFormat simple = new java.text.SimpleDateFormat();
//		try{
//			simple.applyPattern("HHmmss");
//			date = simple.parse("131313");
//			//scheduler.schedule(timetable, student)
//		}
//		catch(Exception e){
//			
//		}
//		finally {
//			
//		}
//		
//		Scheduler s1 = new Scheduler();
//		Timetable t1 = new Timetable();
//		
//		
//		//s1.schedule(t1, student);
//		
//		assertEquals(date, t1.getDate());
//		//result = scheduler.schedule(timetable, student);
//		//assertEquals(, );
//	}
}